package com.graducationdesign.springboot.controller.Student;

import com.graducationdesign.springboot.entities.Administrator.GraducationDesignListMoudle.GraducationDesign;
import com.graducationdesign.springboot.entities.Administrator.PersonnalInformationMoudle.Teacher;
import com.graducationdesign.springboot.entities.Student.GraducationDesign.AllGraducationDesign;
import com.graducationdesign.springboot.mapper.AllGraducationDesignMapper;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Map;

/**
 * @author Mr.zhneg
 * @create 2019-12-02-21:31
 */
@Controller
public class AllGraducationDesignForStuController {
    org.slf4j.Logger logger=  LoggerFactory.getLogger(getClass());

    @Autowired
    AllGraducationDesignMapper allGraducationDesignMapper;

    @GetMapping("/alldesignsforstu")
    public String list(AllGraducationDesign allGraducationDesign, Map<String,Object> map){

        logger.info("所有毕业设计查询"+allGraducationDesign);
        List<AllGraducationDesign> graducationDesigns= allGraducationDesignMapper.getGraducationDesigns(allGraducationDesign);


        map.put("allGraducationDesign",graducationDesigns);
        map.put("name",allGraducationDesign.getDesignname());
        return "Student/graduationDesignMoudle/allgraduationdesignlist";
    }

    @GetMapping("/viewgraductiondesignsforstu/{id}")
    public String viewgraductiondesignsforstu(Map<String,Object> map, @PathVariable("id") Integer id){

        logger.info("查看毕业设计：");
        AllGraducationDesign allGraducationDesigns=allGraducationDesignMapper.viewGraducationDesignfortea(id);
        map.put("allGraducationDesignsforteacher",allGraducationDesigns);

        return "Student/graduationDesignMoudle/graduationdesignview";
    }
}
